package com.example.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author :lihao
 * @date :2020/11/30
 * @description : 自定义权重
 */
@Configuration
public class MyRibbonRule {

    @Bean
    public IRule myRule() {
        // 默认轮询，现在自定义自己的
        //return new MyRandomRule();
        return new RoundRobinRule();
    }
}
